package com.ks.core.framework.cpsupload.demos.orderpayinvoice.orderhandler;

import com.ks.core.framework.cpsupload.demos.orderpayinvoice.constant.InvoiceType;

// 已退款状态处理器
class RefundedStateHandler implements OrderStateHandler {
    @Override
    public void handle(Order order) {
        // 恢复库存
        InventoryService.increaseInventory(order.getOrderType(), order.getItemId());
        
        // 红冲发票
        if (order.isInvoiceIssued()) {
            InvoiceService.generateInvoice(order, InvoiceType.RED);
        }
    }
}